/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_main_kitchen")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterMainKitchen.findAll", query = "SELECT p FROM PosMasterMainKitchen p"),
//    @NamedQuery(name = "PosMasterMainKitchen.findBySync", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenId", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenId = :mainKitchenId"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenName", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenName = :mainKitchenName"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenAddress", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenAddress = :mainKitchenAddress"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenPhone", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenPhone = :mainKitchenPhone"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenEmail", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenEmail = :mainKitchenEmail"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenContact", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenContact = :mainKitchenContact"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenContactPhone", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenContactPhone = :mainKitchenContactPhone"),
//    @NamedQuery(name = "PosMasterMainKitchen.findByMainKitchenContactEmail", query = "SELECT p FROM PosMasterMainKitchen p WHERE p.mainKitchenContactEmail = :mainKitchenContactEmail")})
public class PosMasterMainKitchen implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "main_kitchen_id")
    private Integer mainKitchenId;
    @Column(name = "main_kitchen_name")
    private String mainKitchenName;
    @Column(name = "main_kitchen_address")
    private String mainKitchenAddress;
    @Column(name = "main_kitchen_phone")
    private String mainKitchenPhone;
    @Column(name = "main_kitchen_email")
    private String mainKitchenEmail;
    
    @Lob
    @Column(name = "main_kitchen_description")
    private String mainKitchenDescription;
    @JoinColumn(name = "main_kitchen_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional mainKitchenRegionalId;
    @JoinColumn(name = "main_kitchen_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit mainKitchenUnitId;
    
    
    public PosMasterMainKitchen() {
    }

    public PosMasterMainKitchen(Integer mainKitchenId) {
        this.mainKitchenId = mainKitchenId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getMainKitchenId() {
        return mainKitchenId;
    }

    public void setMainKitchenId(Integer mainKitchenId) {
        this.mainKitchenId = mainKitchenId;
    }

    public String getMainKitchenName() {
        return mainKitchenName;
    }

    public void setMainKitchenName(String mainKitchenName) {
        this.mainKitchenName = mainKitchenName;
    }

    public String getMainKitchenAddress() {
        return mainKitchenAddress;
    }

    public void setMainKitchenAddress(String mainKitchenAddress) {
        this.mainKitchenAddress = mainKitchenAddress;
    }

    public String getMainKitchenPhone() {
        return mainKitchenPhone;
    }

    public void setMainKitchenPhone(String mainKitchenPhone) {
        this.mainKitchenPhone = mainKitchenPhone;
    }

    public String getMainKitchenEmail() {
        return mainKitchenEmail;
    }

    public void setMainKitchenEmail(String mainKitchenEmail) {
        this.mainKitchenEmail = mainKitchenEmail;
    }

    public String getMainKitchenDescription() {
        return mainKitchenDescription;
    }

    public void setMainKitchenDescription(String mainKitchenDescription) {
        this.mainKitchenDescription = mainKitchenDescription;
    }

    public PosMasterRegional getMainKitchenRegionalId() {
        return mainKitchenRegionalId;
    }

    public void setMainKitchenRegionalId(PosMasterRegional mainKitchenRegionalId) {
        this.mainKitchenRegionalId = mainKitchenRegionalId;
    }

    public MasterUnit getMainKitchenUnitId() {
        return mainKitchenUnitId;
    }

    public void setMainKitchenUnitId(MasterUnit mainKitchenUnitId) {
        this.mainKitchenUnitId = mainKitchenUnitId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mainKitchenId != null ? mainKitchenId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterMainKitchen)) {
            return false;
        }
        PosMasterMainKitchen other = (PosMasterMainKitchen) object;
        if ((this.mainKitchenId == null && other.mainKitchenId != null) || (this.mainKitchenId != null && !this.mainKitchenId.equals(other.mainKitchenId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return mainKitchenName;
//        return "com.buanalintas.ronsicecream.pos.entities.PosMasterMainKitchen[ mainKitchenId=" + mainKitchenId + " ]";
    }
    
}
